package com.ruoyi.business.api.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 店铺信息管理对象 shop
 *
 * @author dxw
 * @date 2024-09-12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Shop implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @Id //表示当前属性为主键
    private Long id;

    /**
     * 店名
     */
    @Excel(name = "店名")
    @Field(name = "name", type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    /**
     * 经营区域
     */
    @Excel(name = "经营区域")
    @Field(name = "operating_area", type = FieldType.Text, analyzer = "ik_max_word")
    private String operatingArea;

    /**
     * 注册时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "注册时间", width = 30, dateFormat = "yyyy-MM-dd")
    @Field(name = "reg_time", type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd")
    private Date regTime;

    /**
     * 开始营业时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始营业时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Field(name = "start_time", type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 停止营业时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "停止营业时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Field(name = "end_time", type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 详细地址
     */
    @Excel(name = "详细地址")
    @Field(name = "address", type = FieldType.Keyword)
    private String address;

    /**
     * 经度
     */
    @Excel(name = "经度")
    @Field(name = "longitude", type = FieldType.Keyword)
    private String longitude;

    /**
     * 纬度
     */
    @Excel(name = "纬度")
    @Field(name = "latitude", type = FieldType.Keyword)
    private String latitude;

    /**
     * 商家介绍
     */
    @Excel(name = "商家介绍")
    @Field(name = "description", type = FieldType.Text, analyzer = "ik_max_word")
    private String description;

    /**
     * 门店照片【缩略图】
     */
    @Field(name = "photo", type = FieldType.Keyword, index = false)
    @Excel(name = "门店照片【缩略图】")
    private String photo;

    /**
     * 商家评分，默认值0
     */
    @Excel(name = "商家评分，默认值0")
    @Field(name = "rate", type = FieldType.Integer)
    private Integer rate;

    /**
     * 经营状态（0正常、1放假）
     */
    @Excel(name = "经营状态", readConverterExp = "0=正常、1放假")
    @Field(name = "rate", type = FieldType.Integer)
    private Integer status;

    /**
     * 审核状态(0待审核、1系统已审核、2已审核、3已拒绝)
     */
    @Excel(name = "审核状态(0待审核、1系统已审核、2已审核、3已拒绝)")
    @Field(name = "auditStatus_id", type = FieldType.Integer)
    private Integer auditStatusId;

    /**
     * 删除状态(0未删除1已删除)
     */
    @Excel(name = "删除状态(0未删除1已删除)")
    @Field(name = "deleted", type = FieldType.Integer)
    private Integer deleted;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(name = "update_time", type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    // 商户认证对象
    private ShopVerification shopVerification;
    // 认证查询信息
    private String director;
    private String mobile;

    // 店铺图片对象集合
    private List<ShopImgs> shopImgsList;

    //系统用户
    private String avatar;
    private String email;
    private String sex;
}
